package edu.wpi.first.wpilibj.frc_2011;

/**
 * Move arm up thread
 * @author Daniel Flaws
 */

public class ArmMoveUp implements Runnable {
    public void run() {
        double angle = getGyroAngle();
        double maxAngle = 96;
        double intent = (-FRC_2011.rightStick.getRawAxis(3) + 1) * maxAngle / 2;
        if (angle < intent) {
            while (angle < intent) {
                FRC_2011.winch1.set(.7);
                FRC_2011.winch2.set(.7);
                angle = getGyroAngle();
                intent = (-FRC_2011.rightStick.getRawAxis(3) + 1) * maxAngle / 2;
            }
            FRC_2011.winch1.set(0);
            FRC_2011.winch2.set(0);
        }
    }
    public double getGyroAngle() {
        double gyroAngle = FRC_2011.getGyroAngle();
        return gyroAngle;
    }
}